﻿using System;
using System.Net;

namespace SCG.SolarVengeanceEngine.StarShips
{
    //MineSweeper
    public class MineSweeper : StarShip
    {
        //constructor
        public MineSweeper(SVGame game, Player owner, int engines, int armor, StarSystem origin)
            : base(game, owner, engines, armor, origin)
        {
        }

        //Name
        public override string Name
        {
            get
            {
                return "MineSweeper";
            }
        }

        //description
        public override string Description
        {
            get
            {
                return "MineSweepers possess Armor that can absorb E-Mine detonations.  When a MineSweeper is next to an E-Mine, the E-Mine explodes as normal, but the MineSweeper suffers only 1 damage point to its Armor.";
            }
        }

        //ship type
        public override StarShipType ShipType
        {
            get
            {
                return StarShipType.MineSweeper;
            }
        }

        //let them target emines
        public override bool CanExecuteOrder(OrderType ot)
        {
            switch (ot)
            {
                case OrderType.TargetStarShip:
                    return true;
                default:
                    return base.CanExecuteOrder(ot);
            }
        }
        public override bool CanTargetStarShip(StarShip ship, bool respectAlliance)
        {
            if (!ship.DiscoveredBy[Owner])
                return false;
            if (!ship.VisibleTo[Owner])
                return false;
            return ship.ShipType == StarShipType.EMine;
        }
    }
}
